package com.example.flowable.model;

import lombok.Data;
import org.flowable.task.api.DelegationState;
import org.flowable.task.api.Task;

import java.util.Date;

@Data
public class TaskDTO {
    private String id;
    private DelegationState delegationState;
    private String category;
    private Date claimTime;
    private Date createTime;
    private String description;
    private Date deuDate;
    private String executionId;
    private String formKey;
    private String name;
    private String owner;
    private String parentTaskId;
    private int priority;
    private String processDefinitionId;
    private String processInstanceId;
    private String scopeDefinitionId;
    private String scopeId;
    private String scopeType;
    private String subScopeId;
    private String taskDefinitionId;
    private String taskDefinitionKey;
    private String tenantId;
    private String businessKey;

    public TaskDTO(Task task) {
        this.id = task.getId();
        this.delegationState = task.getDelegationState();
        this.category = task.getCategory();
        this.claimTime = task.getClaimTime();
        this.createTime = task.getCreateTime();
        this.description = task.getDescription();
        this.deuDate = task.getDueDate();
        this.executionId = task.getExecutionId();
        this.formKey = task.getFormKey();
        this.name = task.getName();
        this.owner = task.getOwner();
        this.parentTaskId = task.getParentTaskId();
        this.priority = task.getPriority();
        this.processDefinitionId = task.getProcessDefinitionId();
        this.processInstanceId = task.getProcessInstanceId();
        this.scopeDefinitionId = task.getScopeDefinitionId();
        this.scopeId = task.getScopeId();
        this.scopeType = task.getScopeType();
        this.subScopeId = task.getSubScopeId();
        this.taskDefinitionId = task.getTaskDefinitionId();
        this.taskDefinitionKey = task.getTaskDefinitionKey();
        this.tenantId = task.getTenantId();
    }
}
